package me.zk.practice1.hw;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author zhangkai
 * @date 2023/8/14 17:17
 */
public class HWBJJ38 {

    private static int[] nums = null;

    private static boolean[] used = null;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);


        nums = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();

        Arrays.sort(nums);
        used = new boolean[nums.length];

        int m1 = getLevel(nums[nums.length-1]);

        int m2 = getLevel(nums[0]+nums[nums.length-1]);
        System.out.println(Math.max(m1,m2));

    }

    private static int getLevel(int levelLength) {

        int maxLen = 0;

        int i =0,j=0;
        for (i=nums.length-1; i > 0;i--){
            if (nums[i] == levelLength) {
                maxLen+=1;
                used[i]=true;
                continue;
            }
            if (!used[i]){
                for (j = 0; j < i; j++) {
                    if (nums[i]+nums[j]==levelLength&&!used[j]){
                        maxLen+=1;
                        used[i]=true;
                        used[j]=true;
                        break;
                    }
                }
                //未找到，回退
                if (i==j){
                    for (i=0;i<nums.length;i++){
                        used[i]=false;
                    }
                    return -1;
                }

            }
        }
        if (nums[0]==levelLength) {
            maxLen+=1;
        }
        for (int l = 0; l < nums.length; l++) {
            if (!used[l]){
                maxLen = -1;
            }
            used[l]=false;
        }
        return maxLen;



    }
}
